<?php


namespace app\common\command;


use app\common\cachemodel\ZlUserVip;
use think\console\Command;
use think\console\Input;
use think\console\Output;

class VipTask extends Command
{
    /**
     * 命令配置
     */
    protected function configure()
    {
        $this->setName('vip:ranking:task')->setDescription('VIP任务排行榜及其他');
    }

    /**
     * 执行任务
     * @param Input $input
     * @param Output $output
     * @return int|void|null
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     * @throws \think\exception\PDOException
     */
    protected function execute(Input $input, Output $output)
    {
        // 排行榜统计
        (new ZlUserVip())->vipRanking();
        // 会员过期 扣减
        (new ZlUserVip())->vipExpire();
    }
}
